package geppetto.reordering;

import java.util.ArrayList;

import geppetto.cat.alignments.AlignmentsSet;
import geppetto.phraseHMM.phraseExtraction.extractedphrase.ExtractedPhrasePair;

public class AlignmentScoreWeightedMSDReorderingCalculator extends AlignmentWeightedMSDReorderingCalculator{
	public AlignmentScoreWeightedMSDReorderingCalculator(REO_MODEL_TYPE modelType,AlignmentsSet set) {
		this(DEFAULTSMOOTHING,modelType, set);
	}
	
	public AlignmentScoreWeightedMSDReorderingCalculator(double smoothing, REO_MODEL_TYPE modelType,AlignmentsSet set) {
		super(smoothing, modelType, set);
		this.modelType = modelType;
		this.set = set;
		setSmoothing(smoothing);
	}

	public AlignmentScoreWeightedMSDReorderingCalculator(AlignmentsSet set) {
		this(REO_MODEL_TYPE.REO_MSD, set);
	}
	
	@Override
	public ReorderingInfo getReorderingInfo(ExtractedPhrasePair epp) {
		ReorderingInfo ret = super.getReorderingInfo(epp);
		for(int key = 0; key < ret.getPreviousWordOrientations().length; key++){
			double[] reords = ret.getPreviousWordOrientations()[key];
			for(int i = 0; i < reords.length; i++){
				reords[i] =reords[i] * epp.getScore();
			}
		}
		for(int key = 0; key < ret.getNextWordOrientations().length; key++){
			double[] reords = ret.getNextWordOrientations()[key];
			for(int i = 0; i < reords.length; i++){
				reords[i] =reords[i] * epp.getScore();
			}
		}
		return ret;
	}
}
